{% extends "panel/panel_base.html" %}
{% load thumb %}
{% block extra_head %}

{% endblock %}
{% block panel_title%}Editing Image "{{images.title|truncatewords:2}}"{% endblock %}
{% block panel_content %}
{% if errors %}
	<div id="gen_error_message">
		Errors: 
		<ul>
			{% if title_error %}<li>The title field is required.</li>{% endif %}
			{% if description_error %}<li>The description field is required.</li>{% endif %}				
		</ul>
	</div>
{% endif %}
{% if success %}
	<div id="gen_success">
		<ul>
			<li>Image Successfully Edited</li>			
		</ul>
	</div><br />
{% endif %}

<form enctype="multipart/form-data" action="" method="post">
	<table>
		<tr>
			<td>Title: </td>
			<td><input type="text" name="title" value="{{ title }}" class="register_text" /></td>
		</tr>
		<tr>
			<td valign="top">Description: </td>
			<td><textarea id="description" rows="10" cols="40" name="description" class="register_text">{{ description }}</textarea></td>
		</tr>	
		<tr>
			<td valign="top">Image: </td>
			<td><img class="preview" alt="{{images..title}}" src="{{images.image|thumbnail:"150x150"}}" /></td>
		</tr>
		<tr>
			<td></td>
			<td>
				<input type="submit" name="save" class="register_button" value="Save &rarr;" />
				<a href="http://fblaconnection.com/panel/{{user.username}}/gallery/{{ugallery.id}}/image/{{images.id}}/edit/?ex=delete"><div id="reg_button_div">Delete</div></a>
			</td>
		</tr>
	</table>
</form>

{% endblock %}